<!DOCTYPE html>
<html class="ui-page-login">

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>注册</title>
		<link href="css/mui.min.css" rel="stylesheet" />
		<link href="css/style.css" rel="stylesheet" />
		<link href="css/reg_style.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/common.css"/>
		<style type="text/css">
			header em{
				color: #4198FF;
			}
			.head1 em{
				float: left;
				width: 0.27rem;
				height: 0.36rem;
			}
			.head1 .img1 {
				float: left;
				width: 0.15rem;
				height: 0.15rem;
				margin-top: 0.1rem;
				margin-left: 0.07rem;
			}
		</style>

	</head>

	<body>
		<header class="mui-bar mui-bar-nav head1">
			<em class="mui-action-back"><img class="img1" src="img/fanhui.png" alt="" /></em>
		</header>
		<div class="mui-content">
			<div class="mui-content-padded content-box">
				<h3 class="title-ver">请输入新密码</h3>
				<form id='login-form' class="mui-input-group">
					<div class="mui-input-row char4">
						<label>新密码</label>
						<input onkeyup="judge_psw()" maxlength="16" id='password' type="password" data-input-password="2" class="mui-input-clear mui-input-password" placeholder="请输入新密码">
					</div>
					<div class="mui-input-row char4">
						<label>再次输入</label>
						<input onkeyup="judge_psw()" maxlength="16" id='passwordtoo' type="password" data-input-password="2" class="mui-input-clear mui-input-password" placeholder="请再次输入密码">
					</div>
				</form>
				<div class="link-area forgetPassword red">
					<a id='forgetPassword'>&nbsp;</a>
				</div>
				<button id='btn_login' class="mui-btn mui-btn-block mui-btn-primary" onclick="user_join_add_setpsw();" disabled="disabled" style="width: 110%;margin-left: -5%;">下一步</button>

			</div>
			<div class="mui-content-padded oauth-area">

			</div>
		</div>

		<script src="js/mui.min.js"></script>
		<script src="js/mui.enterfocus.js"></script>
		<script src="js/app.js"></script>
		<script src="js/jquery.js"></script>
		<script src="js/common.js"></script>
		<script>
			//判断两次密码，是否正确
			function judge_psw() {
				
				var password = mui('#password')[0].value;
				var passwordtoo = mui('#passwordtoo')[0].value;
				if(passwordtoo == password) {
					document.getElementById("btn_login").disabled = false;
					btn_login_se('jianbian3_shengse',"#btn_login");
					mui("#forgetPassword")[0].innerHTML = '&nbsp;';
				} else {
					document.getElementById("btn_login").disabled = true;
					btn_login_se('jianbian1_qianse',"#btn_login");
					if(passwordtoo==''||password=='') {
						mui("#forgetPassword")[0].innerHTML = '&nbsp;';
					} else {
						mui("#forgetPassword")[0].innerHTML = '两次输入的密码不一致，请重新输入';
					}

				}

			}

			//存新密码
			function user_join_add_setpsw() {
				
//				var str=$("#password").val();
//				function check(str) { 
//					var cnt = 0; 
//					if (/[a-zA-Z]+/.test(str)) cnt++; 
//					if (/[0-9]+/.test(str)) cnt++; 
//					if (/_+/.test(str)) cnt++; 
//					if (cnt < 2) return false;
//					return /^\w{6,20}$/.test(str);
//				}
//				check();
				
				//存储到loaclStage   
				storage["register_psw"] = mui('#password')[0].value;
				var phoneVeg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$/;
				if(phoneVeg.test($("#password").val())) {

				window.location.href = "reg_user_join_add.html"
				}
				else{
					alert('请输入8-16位包含字母的密码')
				}
			}
		</script>
	</body>

</html>